#include<bits/stdc++.h>
#define sd(n) scanf("%d",&n) 
#define sld(n) scanf("%lld",&n)
#define pd(n) printf("%d", (n))
#define pld(n) printf("%lld", n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fi first
#define se second
const int N = 2e5;
#define INF 0x7fffffff
typedef long long int ll;
using namespace std;
//----------------------------------------------------------------------------//
int a[N];
void solve()
{
	int n;
	sd(n);
	for (int i = 1; i <= n; i++) sd(a[i]);
	sort(a+1,a+n+1);
	int mi=a[1];
	int mx=a[n];
	
	if(mx==mi)
	{
		pd(n);
		return;
	}


	int d=a[1];
	for (int i =2; i <= n; i++) d= __gcd(d, a[i]);
	
	if(n==2)
	{
		pd(2);
		return;
	}
	int a=mi/d;
	int b=mx/d;
	pd(b-a+1);
}

int main()
{
	int T = 1;
	//sd(T);
	while (T--)
	{
		solve();
	}
	return 0;
}